<template>
  <footer>
    <ul>
      <li
        v-for="(item, index) in footerList"
        :key="item.title"
        @click="handleClick(index)"
        :class="{ active: index === active }"
      >
        <span class="iconfont" :class="item.icon"></span>
        <p>{{ item.title }}</p>
      </li>
    </ul>
  </footer>
</template>

<script>
export default {
  data() {
    return {
      footerList: [
        {
          icon: "icon-dianying",
          title: "电影/影院",
        },
        {
          icon: "icon-shipin-",
          title: "视频",
        },
        {
          icon: "icon-paishipin",
          title: "小视频",
        },
        {
          icon: "icon-dianyingpiao",
          title: "演出",
        },
        {
          icon: "icon-wode",
          title: "我的",
        },
      ],
      active: 0,
    };
  },
  methods: {
    handleClick(i) {
      this.active = i;
    },
  },
};
</script>

<style lang="less" scoped>
@import "../../assets/css/var.less";
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background-color: #fff;
  border-top: 1px solid #ccc;
  font-size: 20px;
  ul {
    width: 375px;
    height: 49px;
    display: flex;
    justify-content: space-around;
    li {
      text-align: center;
    }
    .iconfont {
      font-size: @xxl-font;
    }
    p {
      font-size: @xxs-font;
      text-align: center;
      line-height: 12px;
    }
  }
}
.active {
  color: @bg-color;
}
</style>
